#!/bin/bash
function yzmanagement()
{
   cat <<yzmanagement
***********************************
  
  1.启动Yunzai-Bot
  
  2.停止Yunzai-Bot
  
  3.完全重新配置账号
  
  0.退出Yunzai管理

***********************************
yzmanagement
}

function managementoptions()
{
read -p "请输入您需要操作的项目: " numbak
    case $numbak in
    
    1)
      yz
      ;;
    2)
      yzstop
      ;;
    3)
      account
      ;;
    0)
      exit
      ;;
      
    esac
}

function account()
{
      pushd ~/Yunzai-Bot/config/config
      rm -rf other.yaml qq.yaml group.yaml redis.yaml
      pushd ~/Yunzai-Bot/data
      read -p "请输入您要重置的账号: " text
      case $text in
      $text)
      rm -rf $text --no-preserve-root
  esac
      echo -e '\033[36m 执行成功 \033[0m'
      pushd ~/Yunzai-Bot
      npm run login
}

function main()   
{
    while true
    do
        yzmanagement
        managementoptions
    done
}
main
